package com.five.api.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.five.entity.CourseComment;
import com.five.entity.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 课程评论表 Mapper 接口
 * </p>
 *
 * @author star
 * @since 2021-06-16
 */
public interface CourseCommentMapper extends BaseMapper<CourseComment> {
    /**
     * 根据课程id查询课程评论内容
     * @param courseId
     * @return
     */
    List<CourseComment> selectCourseComment(@Param("courseId") Integer courseId);


    /**
     * 提交评论
     * @param content
     * @param courseId
     * @param userId
     */
    int insertCourseComment(String content,Long courseId,Long userId);

    /**
     * 通过用户名查询用户ID
     * @param username
     * @return
     */
    User selUserIdByUserName(String username);
}
